let str = '1+12-31+100-93'

function calculator(str) {
    return eval(str)
}

let num = calculator(str)
console.log(num)